home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / QHELP135.ZIP / QHELP135.DOC < prev   
Text File  |  1987-03-26  |  7KB  |  107 lines

  1.                         QHELP135.COM by Bob Montgomery 3/26/87
  2.      
  3.      This program is an example of HELP.ASM by Bob Montgomery, which was a 
  4.      rewrite of QHELP.ASM by Kurt Schelin, and is a template for creating 
  5.      your own popup help screens. It contains all of the assembly code 
  6.      required to make your message pop up using your choice of a shift key 
  7.      combination for the hot keys; the shift keys are Cntrl, Alt, Left 
  8.      Shift, Right Shift, Caps Lock, Number Lock, and Scroll Lock. The code 
  9.      is written in A86 assembler formats; I prefer A86 because it doesn't 
  10.      need the org, segment, assume, ends, etc assembler directives and is 
  11.      a little smarter. Border characters can be used to partition the help 
  12.      display, and to make it look more professional. The program 
  13.      automatically centers the help screen on the display, in the colors 
  14.      you selected with the Colattr equate.
  15.      
  16.      The help message can be any message you desire with the following 
  17.      restrictions:
  18.           1. The message must not exceed 80 characters/line-dictated by 
  19.              screen width.
  20.           2. The message cannot exceed 25 lines-dictated by the screen 
  21.              length.
  22.           3. Each line must be the same length-blank filled to make so.
  23.  
  24.      To make your own help screen, pick a combination of shift keys to be 
  25.      your hot keys and change the equate called Hotkey to the sum of these 
  26.      keys. In the template, the hot keys are Cntrl-Left Shift. Then, 
  27.      change the Colattr equate for the colors you want the help window to 
  28.      be; the first nibble is the background color (0-7), and the second 
  29.      nibble is the foreground color (0-15). If you want the help window to 
  30.      blink, add 8 to the background color. Then change the db statements 
  31.      at Hlpst and the following lines to your message; remember that each 
  32.      line must have the same number of characters. In the template, each 
  33.      line is a different upper case alphabetic letter. You may have from 1 
  34.      to 80 characters/line, and you may have from 1 to 25 lines for your 
  35.      help screen. The program will automatically center the help screen on 
  36.      the display; that's what the equates following the help message do. 
  37.      Then, assemble the source to the filename of your choice, and you 
  38.      have a help screen COM program. The help screen for QEdit135 is used 
  39.      in this example.
  40.      
  41.      The program works with all displays (Monochrome, CGA, and EGA) in all 
  42.      80 column text modes (will not work in graphics mode). It is a 
  43.      'terminate and stay resident' program, and can be used with MARK & 
  44.      RELEASE to free up memory when it is no longer required. For 
  45.      instance, with QEdit, I do MARK, QHELP, QEDIT (filename), RELEASE in 
  46.      a batch file or as CED synonyms.
  47.      
  48.      The source is liberally commented so you can understand how it works. 
  49.      The first thing that happens when you call it is a jump to the 
  50.      initialize routine, which gets and saves the old keyboard interrupt 
  51.      (Int 9) and the vectors the keyboard interrupt to this program. Then, 
  52.      it terminates but stays resident, and the Start portion of the 
  53.      program handles all keyboard interrupts from this point on. 
  54.      
  55.      A keyboard interrupt is generated each time a key is pressed or 
  56.      released, and the neccessary steps required to get the key are known 
  57.      only to the BIOS Int 9 routine. Therefore, we must call the BIOS Int 
  58.      9 routine from this program to handle the key action. The only 
  59.      problem with this is that the BIOS Int 9 program is an interrupt 
  60.      handler and not a subroutine, which means it pops the return address 
  61.      (like a subroutine) and the flag register at completion. To fake it 
  62.      out and keep the stack pointer where it should be, we push the flags 
  63.      before calling the BIOS Int 9 routine (as a subroutine), and it pops 
  64.      the flags when it is done. The only thing the program looks for is 
  65.      the hot key combination on each keyboard interrupt, and it uses a 
  66.      BIOS service (Int 16-get shift status) to do this. Any other keys are 
  67.      ignored, but the action required to record the key press or release 
  68.      has been done by the call to the BIOS Int 9 routine in the new Int 9 
  69.      program.  If the hot keys have been pressed, the program checks a 
  70.      flag to see if the help screen is already up; if so, the hot keys are 
  71.      ignored. This is done in the Start portion of the program.
  72.      
  73.      If the hot keys are pressed and the help screen is not up, the 
  74.      program then determines the current video mode and page, and saves 
  75.      it. From this, the current video display area of memory is 
  76.      determined. Then, the cursor is disabled and the help window area of 
  77.      the display is copied to a buffer in the program, so it can be 
  78.      restored when the help window is removed. The help window data is 
  79.      then copied to display memory with whatever attribute (color) you 
  80.      selected, and the display is then unblanked. A flag is set to 
  81.      indicate that the help window is up. Your help data is now visible on 
  82.      the display, and is centered horizontally and vertically, and in the 
  83.      color you selected with the Colattr equate (if you have a color 
  84.      display). To avoid 'snow' on CGA monitors while video memory is being 
  85.      accessed, the display is blanked during video read/write times, and 
  86.      blanking and unblanking occur at vertical retrace time; this is not 
  87.      done for the monochrome monitor, since it doesn't have the 'snow' 
  88.      problem.
  89.      
  90.      Now the program waits for the Escape key, and ignores all others. 
  91.      When the Escape key is finally pressed, video is disabled and the old 
  92.      screen data is put back on the display. Then the cursor is enabled 
  93.      and the display is unblanked, and you have your original screen back.
  94.      The flag which indicates the help screen is up is cleared, and the 
  95.      program resumes looking for the hot keys.
  96.      
  97.      I hope this program is of some use to you, and you are free to copy 
  98.      and distribute it, but please distribute it in its original form so 
  99.      it can be used by others. I also hope you follow the source listing, 
  100.      and maybe learn something in the process. This is my contribution to 
  101.      the shareware community. Enjoy the program. 
  102.      
  103.      If you have any comments or suggestions, I can be contacted at the 
  104.      Black Hole BBS in Orlando, Fl., 1200/2400 Baud (305) 260-6397.
  105.      
  106.      Bob Montgomey
  107.